.class Lcom/brixd/niceapp/community/activity/AlbumListActivity$3;
.super Ljava/lang/Object;
.source "AlbumListActivity.java"

# interfaces
.implements Landroid/app/LoaderManager$LoaderCallbacks;


# annotations
.annotation system Ldalvik/annotation/EnclosingMethod;
    value = Lcom/brixd/niceapp/community/activity/AlbumListActivity;->initAlbumModels()V
.end annotation

.annotation system Ldalvik/annotation/InnerClass;
    accessFlags = 0x0
    name = null
.end annotation

.annotation system Ldalvik/annotation/Signature;
    value = {
        "Ljava/lang/Object;",
        "Landroid/app/LoaderManager$LoaderCallbacks",
        "<",
        "Landroid/database/Cursor;",
        ">;"
    }
.end annotation


# instance fields
.field final synthetic this$0:Lcom/brixd/niceapp/community/activity/AlbumListActivity;

.field final synthetic val$columns:[Ljava/lang/String;

.field final synthetic val$images:Landroid/net/Uri;


# direct methods
.method constructor <init>(Lcom/brixd/niceapp/community/activity/AlbumListActivity;Landroid/net/Uri;[Ljava/lang/String;)V
    .registers 4
    .param p1, "this$0"    # Lcom/brixd/niceapp/community/activity/AlbumListActivity;

    .prologue
    .line 139
    iput-object p1, p0, Lcom/brixd/niceapp/community/activity/AlbumListActivity$3;->this$0:Lcom/brixd/niceapp/community/activity/AlbumListActivity;

    iput-object p2, p0, Lcom/brixd/niceapp/community/activity/AlbumListActivity$3;->val$images:Landroid/net/Uri;

    iput-object p3, p0, Lcom/brixd/niceapp/community/activity/AlbumListActivity$3;->val$columns:[Ljava/lang/String;

    invoke-direct {p0}, Ljava/lang/Object;-><init>()V

    return-void
.end method


# virtual methods
.method public onCreateLoader(ILandroid/os/Bundle;)Landroid/content/Loader;
    .registers 10
    .param p1, "id"    # I
    .param p2, "args"    # Landroid/os/Bundle;
    .annotation system Ldalvik/annotation/Signature;
        value = {
            "(I",
            "Landroid/os/Bundle;",
            ")",
            "Landroid/content/Loader",
            "<",
            "Landroid/database/Cursor;",
            ">;"
        }
    .end annotation

    .prologue
    .line 143
    new-instance v0, Landroid/content/CursorLoader;

    iget-object v1, p0, Lcom/brixd/niceapp/community/activity/AlbumListActivity$3;->this$0:Lcom/brixd/niceapp/community/activity/AlbumListActivity;

    # invokes: Lcom/brixd/niceapp/community/activity/AlbumListActivity;->getContext()Landroid/content/Context;
    invoke-static {v1}, Lcom/brixd/niceapp/community/activity/AlbumListActivity;->access$300(Lcom/brixd/niceapp/community/activity/AlbumListActivity;)Landroid/content/Context;

    move-result-object v1

    iget-object v2, p0, Lcom/brixd/niceapp/community/activity/AlbumListActivity$3;->val$images:Landroid/net/Uri;

    iget-object v3, p0, Lcom/brixd/niceapp/community/activity/AlbumListActivity$3;->val$columns:[Ljava/lang/String;

    const-string v4, ""

    const/4 v5, 0x0

    const-string v6, "date_modified DESC "

    invoke-direct/range {v0 .. v6}, Landroid/content/CursorLoader;-><init>(Landroid/content/Context;Landroid/net/Uri;[Ljava/lang/String;Ljava/lang/String;[Ljava/lang/String;Ljava/lang/String;)V

    return-object v0
.end method

.method public onLoadFinished(Landroid/content/Loader;Landroid/database/Cursor;)V
    .registers 23
    .param p2, "cur"    # Landroid/database/Cursor;
    .annotation system Ldalvik/annotation/Signature;
        value = {
            "(",
            "Landroid/content/Loader",
            "<",
            "Landroid/database/Cursor;",
            ">;",
            "Landroid/database/Cursor;",
            ")V"
        }
    .end annotation

    .prologue
    .line 148
    .local p1, "loader":Landroid/content/Loader;, "Landroid/content/Loader<Landroid/database/Cursor;>;"
    new-instance v14, Ljava/util/LinkedHashMap;

    invoke-direct {v14}, Ljava/util/LinkedHashMap;-><init>()V

    .line 149
    .local v14, "map":Ljava/util/LinkedHashMap;, "Ljava/util/LinkedHashMap<Ljava/lang/Long;Lcom/brixd/niceapp/community/model/AlbumModel;>;"
    if-eqz p2, :cond_8a

    invoke-interface/range {p2 .. p2}, Landroid/database/Cursor;->moveToFirst()Z

    move-result v15

    if-eqz v15, :cond_8a

    .line 155
    const-string v15, "bucket_id"

    move-object/from16 v0, p2

    invoke-interface {v0, v15}, Landroid/database/Cursor;->getColumnIndex(Ljava/lang/String;)I

    move-result v8

    .line 156
    .local v8, "bucketIdColumn":I
    const-string v15, "bucket_display_name"

    move-object/from16 v0, p2

    invoke-interface {v0, v15}, Landroid/database/Cursor;->getColumnIndex(Ljava/lang/String;)I

    move-result v5

    .line 157
    .local v5, "bucketColumn":I
    const-string v15, "_data"

    move-object/from16 v0, p2

    invoke-interface {v0, v15}, Landroid/database/Cursor;->getColumnIndex(Ljava/lang/String;)I

    move-result v10

    .line 160
    .local v10, "imageDataColumn":I
    :cond_25
    move-object/from16 v0, p2

    invoke-interface {v0, v8}, Landroid/database/Cursor;->getLong(I)J

    move-result-wide v6

    .line 161
    .local v6, "bucketId":J
    move-object/from16 v0, p2

    invoke-interface {v0, v5}, Landroid/database/Cursor;->getString(I)Ljava/lang/String;

    move-result-object v4

    .line 162
    .local v4, "bucket":Ljava/lang/String;
    move-object/from16 v0, p2

    invoke-interface {v0, v10}, Landroid/database/Cursor;->getString(I)Ljava/lang/String;

    move-result-object v9

    .line 164
    .local v9, "data":Ljava/lang/String;
    new-instance v11, Ljava/io/File;

    invoke-direct {v11, v9}, Ljava/io/File;-><init>(Ljava/lang/String;)V

    .line 165
    .local v11, "imageFile":Ljava/io/File;
    invoke-virtual {v11}, Ljava/io/File;->exists()Z

    move-result v15

    if-eqz v15, :cond_84

    invoke-virtual {v11}, Ljava/io/File;->length()J

    move-result-wide v16

    const-wide/16 v18, 0x0

    cmp-long v15, v16, v18

    if-lez v15, :cond_84

    .line 166
    invoke-static {v6, v7}, Ljava/lang/Long;->valueOf(J)Ljava/lang/Long;

    move-result-object v15

    invoke-virtual {v14, v15}, Ljava/util/LinkedHashMap;->get(Ljava/lang/Object;)Ljava/lang/Object;

    move-result-object v2

    check-cast v2, Lcom/brixd/niceapp/community/model/AlbumModel;

    .line 167
    .local v2, "albumModel":Lcom/brixd/niceapp/community/model/AlbumModel;
    if-nez v2, :cond_ad

    .line 168
    new-instance v2, Lcom/brixd/niceapp/community/model/AlbumModel;

    .end local v2    # "albumModel":Lcom/brixd/niceapp/community/model/AlbumModel;
    invoke-direct {v2}, Lcom/brixd/niceapp/community/model/AlbumModel;-><init>()V

    .line 169
    .restart local v2    # "albumModel":Lcom/brixd/niceapp/community/model/AlbumModel;
    invoke-virtual {v2, v6, v7}, Lcom/brixd/niceapp/community/model/AlbumModel;->setAlbumId(J)V

    .line 170
    invoke-virtual {v2, v4}, Lcom/brixd/niceapp/community/model/AlbumModel;->setAlbumName(Ljava/lang/String;)V

    .line 171
    new-instance v15, Ljava/lang/StringBuilder;

    invoke-direct {v15}, Ljava/lang/StringBuilder;-><init>()V

    const-string v16, "file://"

    invoke-virtual/range {v15 .. v16}, Ljava/lang/StringBuilder;->append(Ljava/lang/String;)Ljava/lang/StringBuilder;

    move-result-object v15

    invoke-virtual {v15, v9}, Ljava/lang/StringBuilder;->append(Ljava/lang/String;)Ljava/lang/StringBuilder;

    move-result-object v15

    invoke-virtual {v15}, Ljava/lang/StringBuilder;->toString()Ljava/lang/String;

    move-result-object v15

    invoke-virtual {v2, v15}, Lcom/brixd/niceapp/community/model/AlbumModel;->setImagePath(Ljava/lang/String;)V

    .line 172
    const/4 v15, 0x1

    invoke-virtual {v2, v15}, Lcom/brixd/niceapp/community/model/AlbumModel;->setImageCount(I)V

    .line 173
    invoke-static {v6, v7}, Ljava/lang/Long;->valueOf(J)Ljava/lang/Long;

    move-result-object v15

    invoke-virtual {v14, v15, v2}, Ljava/util/LinkedHashMap;->put(Ljava/lang/Object;Ljava/lang/Object;)Ljava/lang/Object;

    .line 179
    .end local v2    # "albumModel":Lcom/brixd/niceapp/community/model/AlbumModel;
    :cond_84
    :goto_84
    invoke-interface/range {p2 .. p2}, Landroid/database/Cursor;->moveToNext()Z

    move-result v15

    if-nez v15, :cond_25

    .line 183
    .end local v4    # "bucket":Ljava/lang/String;
    .end local v5    # "bucketColumn":I
    .end local v6    # "bucketId":J
    .end local v8    # "bucketIdColumn":I
    .end local v9    # "data":Ljava/lang/String;
    .end local v10    # "imageDataColumn":I
    .end local v11    # "imageFile":Ljava/io/File;
    :cond_8a
    new-instance v3, Ljava/util/ArrayList;

    invoke-direct {v3}, Ljava/util/ArrayList;-><init>()V

    .line 184
    .local v3, "albumModels":Ljava/util/ArrayList;, "Ljava/util/ArrayList<Lcom/brixd/niceapp/community/model/AlbumModel;>;"
    invoke-virtual {v14}, Ljava/util/LinkedHashMap;->keySet()Ljava/util/Set;

    move-result-object v12

    .line 185
    .local v12, "keys":Ljava/util/Set;, "Ljava/util/Set<Ljava/lang/Long;>;"
    invoke-interface {v12}, Ljava/util/Set;->iterator()Ljava/util/Iterator;

    move-result-object v15

    :goto_97
    invoke-interface {v15}, Ljava/util/Iterator;->hasNext()Z

    move-result v16

    if-eqz v16, :cond_b7

    invoke-interface {v15}, Ljava/util/Iterator;->next()Ljava/lang/Object;

    move-result-object v13

    check-cast v13, Ljava/lang/Long;

    .line 186
    .local v13, "long1":Ljava/lang/Long;
    invoke-virtual {v14, v13}, Ljava/util/LinkedHashMap;->get(Ljava/lang/Object;)Ljava/lang/Object;

    move-result-object v16

    move-object/from16 v0, v16

    invoke-virtual {v3, v0}, Ljava/util/ArrayList;->add(Ljava/lang/Object;)Z

    goto :goto_97

    .line 175
    .end local v3    # "albumModels":Ljava/util/ArrayList;, "Ljava/util/ArrayList<Lcom/brixd/niceapp/community/model/AlbumModel;>;"
    .end local v12    # "keys":Ljava/util/Set;, "Ljava/util/Set<Ljava/lang/Long;>;"
    .end local v13    # "long1":Ljava/lang/Long;
    .restart local v2    # "albumModel":Lcom/brixd/niceapp/community/model/AlbumModel;
    .restart local v4    # "bucket":Ljava/lang/String;
    .restart local v5    # "bucketColumn":I
    .restart local v6    # "bucketId":J
    .restart local v8    # "bucketIdColumn":I
    .restart local v9    # "data":Ljava/lang/String;
    .restart local v10    # "imageDataColumn":I
    .restart local v11    # "imageFile":Ljava/io/File;
    :cond_ad
    invoke-virtual {v2}, Lcom/brixd/niceapp/community/model/AlbumModel;->getImageCount()I

    move-result v15

    add-int/lit8 v15, v15, 0x1

    invoke-virtual {v2, v15}, Lcom/brixd/niceapp/community/model/AlbumModel;->setImageCount(I)V

    goto :goto_84

    .line 189
    .end local v2    # "albumModel":Lcom/brixd/niceapp/community/model/AlbumModel;
    .end local v4    # "bucket":Ljava/lang/String;
    .end local v5    # "bucketColumn":I
    .end local v6    # "bucketId":J
    .end local v8    # "bucketIdColumn":I
    .end local v9    # "data":Ljava/lang/String;
    .end local v10    # "imageDataColumn":I
    .end local v11    # "imageFile":Ljava/io/File;
    .restart local v3    # "albumModels":Ljava/util/ArrayList;, "Ljava/util/ArrayList<Lcom/brixd/niceapp/community/model/AlbumModel;>;"
    .restart local v12    # "keys":Ljava/util/Set;, "Ljava/util/Set<Ljava/lang/Long;>;"
    :cond_b7
    move-object/from16 v0, p0

    iget-object v15, v0, Lcom/brixd/niceapp/community/activity/AlbumListActivity$3;->this$0:Lcom/brixd/niceapp/community/activity/AlbumListActivity;

    # getter for: Lcom/brixd/niceapp/community/activity/AlbumListActivity;->mAlbumModels:Ljava/util/ArrayList;
    invoke-static {v15}, Lcom/brixd/niceapp/community/activity/AlbumListActivity;->access$100(Lcom/brixd/niceapp/community/activity/AlbumListActivity;)Ljava/util/ArrayList;

    move-result-object v15

    invoke-virtual {v15}, Ljava/util/ArrayList;->clear()V

    .line 190
    move-object/from16 v0, p0

    iget-object v15, v0, Lcom/brixd/niceapp/community/activity/AlbumListActivity$3;->this$0:Lcom/brixd/niceapp/community/activity/AlbumListActivity;

    # getter for: Lcom/brixd/niceapp/community/activity/AlbumListActivity;->mAlbumModels:Ljava/util/ArrayList;
    invoke-static {v15}, Lcom/brixd/niceapp/community/activity/AlbumListActivity;->access$100(Lcom/brixd/niceapp/community/activity/AlbumListActivity;)Ljava/util/ArrayList;

    move-result-object v15

    invoke-virtual {v15, v3}, Ljava/util/ArrayList;->addAll(Ljava/util/Collection;)Z

    .line 191
    move-object/from16 v0, p0

    iget-object v15, v0, Lcom/brixd/niceapp/community/activity/AlbumListActivity$3;->this$0:Lcom/brixd/niceapp/community/activity/AlbumListActivity;

    # getter for: Lcom/brixd/niceapp/community/activity/AlbumListActivity;->mAdapter:Lcom/brixd/niceapp/community/adapter/AlbumListAdapter;
    invoke-static {v15}, Lcom/brixd/niceapp/community/activity/AlbumListActivity;->access$400(Lcom/brixd/niceapp/community/activity/AlbumListActivity;)Lcom/brixd/niceapp/community/adapter/AlbumListAdapter;

    move-result-object v15

    invoke-virtual {v15}, Lcom/brixd/niceapp/community/adapter/AlbumListAdapter;->notifyDataSetChanged()V

    .line 192
    return-void
.end method

.method public bridge synthetic onLoadFinished(Landroid/content/Loader;Ljava/lang/Object;)V
    .registers 3

    .prologue
    .line 139
    check-cast p2, Landroid/database/Cursor;

    invoke-virtual {p0, p1, p2}, Lcom/brixd/niceapp/community/activity/AlbumListActivity$3;->onLoadFinished(Landroid/content/Loader;Landroid/database/Cursor;)V

    return-void
.end method

.method public onLoaderReset(Landroid/content/Loader;)V
    .registers 2
    .annotation system Ldalvik/annotation/Signature;
        value = {
            "(",
            "Landroid/content/Loader",
            "<",
            "Landroid/database/Cursor;",
            ">;)V"
        }
    .end annotation

    .prologue
    .line 197
    .local p1, "loader":Landroid/content/Loader;, "Landroid/content/Loader<Landroid/database/Cursor;>;"
    return-void
.end method
